'use strict';

module.exports = {
  up: async (queryInterface, Sequelize) => {
     await queryInterface.createTable('user-profile', {
      id: {
        type: Sequelize.INTEGER,
        allowNull: false,
        autoIncrement: true,
        comment: '用户id',
        primaryKey: true,
      },
      use_id: {
        type: Sequelize.INTEGER,
        allowNull: false,
        defaultValue: 0,
        comment: '用户id'
      },
      nickname: {
        type: Sequelize.STRING,
        allowNull: false,
        defaultValue: '',
        comment: '昵称'
      },
      realname: {
        type: Sequelize.STRING,
        allowNull: false,
        defaultValue: '',
        comment: '真实姓名'
      },
      gender: {
        type: Sequelize.STRING,
        allowNull: false,
        defaultValue: '',
        comment: '性别'
      },
      birthday: {
        type: Sequelize.DATE,
        allowNull: false,
        defaultValue: '1999-09-09',
        comment: '出生日期'
      },
      created_at: {
        allowNull: false,
        type: Sequelize.DATE,
        filed: 'created_at',
        comment: '用户注册的时间'
      },
      updated_at: {
        allowNull: false,
        type: Sequelize.DATE,
        filed: 'updated_at',
        comment: '用户更新登录的时间'
      }
      }, {
        tableName: 'user-profile',
        charset: 'utf8mb4',
        collate: 'utf8mb4_bin',
        indexes: [
          {

          }
        ]
      });
  },

  down: async (queryInterface, Sequelize) => {
     await queryInterface.dropTable('user-profile');
  }
};
